package com.migration.model.olddb;

import jakarta.persistence.*;
import lombok.Data;
import java.time.LocalDateTime;
import java.io.Serializable;

/**
 * 完整事故链表 实体类
 * 表名：ra_fault_chains
 * 自动生成的实体类
 */
@Data
@Entity
@Table(name = "ra_fault_chains")
public class RaFaultChains implements Serializable {

    private static final long serialVersionUID = 1L;
    
    /**
     * 主键
     * 主键
     */
    @Id
    @Column(name = "id", nullable = false)
    private Long id;
    
    /**
     * 事故链详情主键
     */
    @Column(name = "fault_chains_detail_id")
    private Long faultChainsDetailId;
    
    /**
     * 事故链类型（1、连续作业 2、间歇操作 3、JSA操作）
     * 默认值: 1
     */
    @Column(name = "fault_chains_type")
    private Byte faultChainsType;
    
    /**
     * 原因主键
     */
    @Column(name = "reason_id")
    private Long reasonId;
    
    /**
     * 项目主键
     */
    @Column(name = "items_id")
    private Long itemsId;
    
    /**
     * 详细步骤主键
     */
    @Column(name = "step_detail_id")
    private Long stepDetailId;
    
    /**
     * 影响链全路径
     */
    @Column(name = "incident_path", length = 128)
    private String incidentPath;
    
    /**
     * 后果主键
     */
    @Column(name = "consequence_id")
    private Long consequenceId;
    
    /**
     * 后果描述
     */
    @Column(name = "effect_desc", length = 128)
    private String effectDesc;
    
    /**
     * 事故链序号json
     */
    @Column(name = "fault_chains_json", length = 1024)
    private String faultChainsJson;
    
    /**
     * 初始风险
     */
    @Column(name = "origin_risk", length = 512)
    private String originRisk;
    
    /**
     * 残余风险
     */
    @Column(name = "remnant_risk", length = 512)
    private String remnantRisk;
    
    /**
     * 建议后
     */
    @Column(name = "after_advise", length = 512)
    private String afterAdvise;
    
    /**
     * 可能性序号
     * 默认值: 0
     */
    @Column(name = "possible_sort")
    private Integer possibleSort;
    
    /**
     * 严重性序号
     * 默认值: 0
     */
    @Column(name = "severity_sort")
    private Integer severitySort;
    
    /**
     * 初始等级序号
     * 默认值: 0
     */
    @Column(name = "origin_grade_sort")
    private Integer originGradeSort;
    
    /**
     * 残余等级序号
     * 默认值: 0
     */
    @Column(name = "remnant_grade_sort")
    private Integer remnantGradeSort;
    
    /**
     * 是否删除（0、否1、是）
     * 默认值: 0
     */
    @Column(name = "is_del", nullable = false)
    private Byte isDel;
    
    /**
     * 创建时间
     * 默认值: CURRENT_TIMESTAMP
     */
    @Column(name = "create_time", nullable = false)
    private java.time.LocalDateTime createTime;
    
    /**
     * 租户主键ID
     * 默认值: 1
     */
    @Column(name = "tenant_id", nullable = false)
    private Integer tenantId;
    
    @Override
    public String toString() {
        return "RaFaultChains{" +
            "id=" + id +
            ", faultChainsDetailId=" + faultChainsDetailId +
            ", faultChainsType=" + faultChainsType +
            ", reasonId=" + reasonId +
            ", itemsId=" + itemsId +
            ", stepDetailId=" + stepDetailId +
            ", incidentPath=" + incidentPath +
            ", consequenceId=" + consequenceId +
            ", effectDesc=" + effectDesc +
            ", faultChainsJson=" + faultChainsJson +
            ", originRisk=" + originRisk +
            ", remnantRisk=" + remnantRisk +
            ", afterAdvise=" + afterAdvise +
            ", possibleSort=" + possibleSort +
            ", severitySort=" + severitySort +
            ", originGradeSort=" + originGradeSort +
            ", remnantGradeSort=" + remnantGradeSort +
            ", isDel=" + isDel +
            ", createTime=" + createTime +
            ", tenantId=" + tenantId +
        '}';
    }
} 